<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <!-- 页面点击小红心 -->
  <script type="text/javascript" src="/js/clicklove.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/pjax@0.2.8/pjax.js"></script> 

  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.1.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/blog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/blog/css/main.css">


<link rel="stylesheet" href="/blog/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"linzhuangrong.gitee.io","root":"/blog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="磁盘IO分析">
<meta property="og:type" content="article">
<meta property="og:title" content="磁盘IO分析">
<meta property="og:url" content="https://linzhuangrong.gitee.io/blog/2019/08/15/%E7%A3%81%E7%9B%98IO%E9%97%AE%E9%A2%98%E5%88%86%E6%9E%90/index.html">
<meta property="og:site_name" content="Rong的博客">
<meta property="og:description" content="磁盘IO分析">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2019-08-14T16:00:00.000Z">
<meta property="article:modified_time" content="2020-08-31T14:06:09.453Z">
<meta property="article:author" content="林壮荣">
<meta property="article:tag" content="linux">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://linzhuangrong.gitee.io/blog/2019/08/15/%E7%A3%81%E7%9B%98IO%E9%97%AE%E9%A2%98%E5%88%86%E6%9E%90/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>磁盘IO分析 | Rong的博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/blog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Rong的博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/blog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://linzhuangrong.gitee.io/blog/2019/08/15/%E7%A3%81%E7%9B%98IO%E9%97%AE%E9%A2%98%E5%88%86%E6%9E%90/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="林壮荣">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Rong的博客">
    </span>
      <header class="post-header">
	  
        <h1 class="post-title" itemprop="name headline">
          磁盘IO分析
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-08-15 00:00:00" itemprop="dateCreated datePublished" datetime="2019-08-15T00:00:00+08:00">2019-08-15</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-08-31 22:06:09" itemprop="dateModified" datetime="2020-08-31T22:06:09+08:00">2020-08-31</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/Linux/%E5%91%BD%E4%BB%A4%E5%B7%A5%E5%85%B7/" itemprop="url" rel="index"><span itemprop="name">命令工具</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
            <div class="post-description">磁盘IO分析</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="一、iostat"><a href="#一、iostat" class="headerlink" title="一、iostat"></a>一、iostat</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><span class="line">yum install sysstat -y</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">iostat -mtx 2</span><br><span class="line"></span><br><span class="line">[root@test-io-02-mysql ~]# iostat -d -x -k 1 10</span><br><span class="line">Linux 3.10.0-957.12.1.el7.x86_64 (test-io-02-mysql)         05&#x2F;30&#x2F;2019      _x86_64_        (24 CPU)</span><br><span class="line"></span><br><span class="line">Device:         rrqm&#x2F;s   wrqm&#x2F;s     r&#x2F;s     w&#x2F;s    rkB&#x2F;s    wkB&#x2F;s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util</span><br><span class="line">sda               0.00     0.00    0.00    0.00     0.02     0.01   129.61     0.00    0.81    0.26    6.88   0.21   0.00</span><br><span class="line">sdb               0.00     9.38    0.01   21.15     0.38   436.30    41.26     0.21    9.84    9.79    9.84   7.09  15.00</span><br><span class="line">dm-0              0.00     0.00    0.02   26.81     0.35   432.87    32.29     0.21    7.79   10.18    7.79   5.45  14.63</span><br><span class="line">dm-1              0.00     0.00    0.00    0.00     0.00     0.00    57.42     0.00   21.41   21.41    0.00  19.91   0.00</span><br><span class="line">dm-2              0.00     0.00    0.00    0.51     0.02     3.42    13.52     0.01   12.00   16.15   11.99  10.74   0.55</span><br><span class="line"></span><br><span class="line">Device:         rrqm&#x2F;s   wrqm&#x2F;s     r&#x2F;s     w&#x2F;s    rkB&#x2F;s    wkB&#x2F;s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util</span><br><span class="line">sda               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00</span><br><span class="line">sdb               0.00     0.00    0.00    2.00     0.00     4.00     4.00     0.01   32.50    0.00   32.50   4.50   0.90</span><br><span class="line">dm-0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.01    0.00    0.00    0.00   0.00   0.90</span><br><span class="line">dm-1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00</span><br><span class="line">dm-2              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">rrqm&#x2F;s：每秒这个设备相关的读取请求有多少被Merge了（当系统调用需要读取数据的时候，VFS将请求发到各个FS，如果FS发现不同的读取请求读取的是相同Block的数据，FS会将这个请求合并Merge）；wrqm&#x2F;s：每秒这个设备相关的写入请求有多少被Merge了。</span><br><span class="line"></span><br><span class="line">rsec&#x2F;s：每秒读取的扇区数；</span><br><span class="line">wsec&#x2F;：每秒写入的扇区数。</span><br><span class="line">rKB&#x2F;s：The number of read requests that were issued to the device per second；</span><br><span class="line">wKB&#x2F;s：The number of write requests that were issued to the device per second；</span><br><span class="line">avgrq-sz 平均请求扇区的大小</span><br><span class="line">avgqu-sz 是平均请求队列的长度。毫无疑问，队列长度越短越好。    </span><br><span class="line">await：  每一个IO请求的处理的平均时间（单位是微秒毫秒）。这里可以理解为IO的响应时间，一般地系统IO响应时间应该低于5ms，如果大于10ms就比较大了。</span><br><span class="line">         这个时间包括了队列时间和服务时间，也就是说，一般情况下，await大于svctm，它们的差值越小，则说明队列时间越短，反之差值越大，队列时间越长，说明系统出了问题。</span><br><span class="line">svctm    表示平均每次设备I&#x2F;O操作的服务时间（以毫秒为单位）。如果svctm的值与await很接近，表示几乎没有I&#x2F;O等待，磁盘性能很好，如果await的值远高于svctm的值，则表示I&#x2F;O队列等待太长，         系统上运行的应用程序将变慢。</span><br><span class="line">%util： 在统计时间内所有处理IO时间，除以总共统计时间。例如，如果统计间隔1秒，该设备有0.8秒在处理IO，而0.2秒闲置，那么该设备的%util &#x3D; 0.8&#x2F;1 &#x3D; 80%，所以该参数暗示了设备的繁忙程度</span><br><span class="line">。一般地，如果该参数是100%表示设备已经接近满负荷运行了（当然如果是多磁盘，即使%util是100%，因为磁盘的并发能力，所以磁盘使用未必就到了瓶颈）。</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h1 id="二、sar"><a href="#二、sar" class="headerlink" title="二、sar"></a>二、sar</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br></pre></td><td class="code"><pre><span class="line"> 1、sar -u 1 5</span><br><span class="line">输出CPU使用情况的统计信息，每秒输出一次，一共输出100次</span><br><span class="line">17时06分01秒       CPU     %user     %nice   %system   %iowait     %idle</span><br><span class="line">17时06分02秒       all      1.27      0.00      0.51      1.01     97.22</span><br><span class="line">17时06分03秒       all      0.00      0.00      0.00      0.00    100.00</span><br><span class="line">17时06分04秒       all      0.00      0.00      0.00      0.00    100.00</span><br><span class="line">17时06分05秒       all      0.25      0.00      0.00      0.00     99.75</span><br><span class="line">17时06分06秒       all      0.00      0.00      0.00      0.51     99.49</span><br><span class="line">Average:          all      0.30      0.00      0.10      0.30     99.29</span><br><span class="line"></span><br><span class="line">CPU      all 表示统计信息为所有 CPU 的平均值。                                       </span><br><span class="line">%user    显示在用户级别(application)运行使用 CPU 总时间的百分比。                  </span><br><span class="line">%nice    显示在用户级别，用于nice操作，所占用 CPU 总时间的百分比。            </span><br><span class="line">%system 在核心级别(kernel)运行所使用 CPU 总时间的百分比。      </span><br><span class="line">%iowait 显示用于等待I&#x2F;O操作占用 CPU 总时间的百分比。</span><br><span class="line">%steal   管理程序(hypervisor)为另一个虚拟进程提供服务而等待虚拟 CPU 的百分比。</span><br><span class="line">%idle    显示 CPU 空闲时间占用 CPU 总时间的百分比。</span><br><span class="line"></span><br><span class="line">tips：</span><br><span class="line">若 %iowait 的值过高，表示硬盘存在I&#x2F;O瓶颈</span><br><span class="line">若 %idle 的值高但系统响应慢时，有可能是 CPU 等待分配内存，此时应加大内存容量</span><br><span class="line">若 %idle 的值持续低于 10，则系统的 CPU 处理能力相对较低，表明系统中最需要解决的资源是 CPU。</span><br><span class="line"></span><br><span class="line">2、sar -b 1 5</span><br><span class="line">显示I&#x2F;O和传送速率的统计信息</span><br><span class="line">17时09分07秒       tps      rtps      wtps   bread&#x2F;s   bwrtn&#x2F;s</span><br><span class="line">17时09分08秒      3.12      3.12      0.00     25.00      0.00</span><br><span class="line">17时09分09秒     89.58      6.25     83.33    141.67    733.33</span><br><span class="line">17时09分10秒     42.71      9.38     33.33    141.67    600.00</span><br><span class="line">17时09分11秒      2.11      2.11      0.00     16.84      0.00</span><br><span class="line">17时09分12秒      1.04      0.00      1.04      0.00    175.00</span><br><span class="line">Average:        27.77      4.18     23.59     65.14    302.30</span><br><span class="line"></span><br><span class="line">tps     每秒钟物理设备的 I&#x2F;O 传输总量                   </span><br><span class="line">rtps    每秒钟从物理设备读入的数据总量                 </span><br><span class="line">wtps    每秒钟向物理设备写入的数据总量                 </span><br><span class="line">bread&#x2F;s 每秒钟从物理设备读入的数据量，单位为 块&#x2F;s   </span><br><span class="line">bwrtn&#x2F;s 每秒钟向物理设备写入的数据量，单位为 块&#x2F;s   </span><br><span class="line"></span><br><span class="line">3、sar -c</span><br><span class="line">每秒钟创建的进程数</span><br><span class="line">15时10分01秒      1.35</span><br><span class="line">15时20分01秒      1.01</span><br><span class="line">15时30分01秒      0.59</span><br><span class="line">15时40分01秒      1.35</span><br><span class="line">15时50分01秒      0.99</span><br><span class="line">16时00分01秒      0.57</span><br><span class="line">16时10分01秒      1.33</span><br><span class="line">16时20分01秒      1.02</span><br><span class="line">16时30分01秒      0.57</span><br><span class="line">16时40分01秒      1.33</span><br><span class="line">16时50分01秒      1.07</span><br><span class="line">17时00分01秒      0.56</span><br><span class="line">17时10分01秒      1.32</span><br><span class="line"></span><br><span class="line">4、sar -n DEV 1 5</span><br><span class="line">输出网络设备状态的统计信息</span><br><span class="line">17时13分42秒     IFACE   rxpck&#x2F;s   txpck&#x2F;s   rxbyt&#x2F;s   txbyt&#x2F;s   rxcmp&#x2F;s   txcmp&#x2F;s rxmcst&#x2F;s</span><br><span class="line">17时13分43秒      eth1   3669.70   4156.57 368362.63 2747714.14      0.00      0.00      0.00</span><br><span class="line">17时13分44秒      eth1   2689.11   2585.15 289661.39 701461.39      0.00      0.00      0.00</span><br><span class="line">17时13分45秒      eth1   3746.00   4077.00 415178.00 2605720.00      0.00      0.00      0.00</span><br><span class="line">17时13分46秒      eth1   3096.00   3241.00 327916.00 1597320.00      0.00      0.00      0.00</span><br><span class="line">17时13分47秒      eth1   2910.00   2834.00 312632.00 957903.00      0.00      0.00      0.00</span><br><span class="line">Average:         eth1   3220.20   3375.60 342592.60 1717931.20      0.00      0.00      0.00</span><br><span class="line"></span><br><span class="line">IFACE      网络设备名                          </span><br><span class="line">rxpck&#x2F;s    每秒接收的包总数                 </span><br><span class="line">txpck&#x2F;s    每秒传输的包总数                  </span><br><span class="line">rxbyt&#x2F;s    每秒接收的字节（byte）总数        </span><br><span class="line">txbyt&#x2F;s    每秒传输的字节（byte）总数        </span><br><span class="line">rxcmp&#x2F;s    每秒接收压缩包的总数              </span><br><span class="line">txcmp&#x2F;s    每秒传输压缩包的总数              </span><br><span class="line">rxmcst&#x2F;s   每秒接收的多播（multicast）包的总数</span><br><span class="line"></span><br><span class="line">5、sar -q 1 5</span><br><span class="line">输出进程队列长度和平均负载状态统计信息</span><br><span class="line">17时16分28秒   runq-sz plist-sz   ldavg-1   ldavg-5 ldavg-15</span><br><span class="line">17时16分29秒         0       160      0.26      0.11      0.03</span><br><span class="line">17时16分30秒         0       160      0.26      0.11      0.03</span><br><span class="line">17时16分31秒         0       160      0.24      0.11      0.03</span><br><span class="line">17时16分32秒         0       160      0.24      0.11      0.03</span><br><span class="line">17时16分33秒         0       160      0.24      0.11      0.03</span><br><span class="line">Average:            0       160      0.25      0.11      0.03</span><br><span class="line"></span><br><span class="line">runq-sz   运行队列的长度（等待运行的进程数）                                     </span><br><span class="line">plist-sz 进程列表中进程（processes）和线程（threads）的数量                    </span><br><span class="line">ldavg-1   最后1分钟的系统平均负载（System load average）                         </span><br><span class="line">ldavg-5   过去5分钟的系统平均负载                                                </span><br><span class="line">ldavg-15 过去15分钟的系统平均负载                                              </span><br><span class="line"></span><br><span class="line">6、sar -r</span><br><span class="line">输出内存和交换空间的统计信息</span><br><span class="line"></span><br><span class="line">7、iostat</span><br><span class="line"></span><br><span class="line">iostat -mtx 2</span><br><span class="line"></span><br><span class="line">tps 每秒钟物理设备的 I&#x2F;O 传输总 量。                                                                                          </span><br><span class="line">Blk_read 读入的数据总量，单位为 块。                                                                                          </span><br><span class="line">Blk_wrtn 写入的数据总量，单位为 块。                                                                                          </span><br><span class="line">kB_read 读入的数据总量，单位为 KB。                                                                                           </span><br><span class="line">kB_wrtn 写入的数据总量，单位为 KB。                                                                                           </span><br><span class="line">MB_read 读入的数据总量，单位为 MB。                                                                                           </span><br><span class="line">MB_wrtn 写入的数据总量，单位为 MB。                                                                                           </span><br><span class="line">Blk_read&#x2F;s 每秒从驱动器读入的数据量，单位为 块 &#x2F;s。                                                                           </span><br><span class="line">Blk_wrtn&#x2F;s 每秒向驱动器写入的数据量，单位为 块 &#x2F;s。                                                                           </span><br><span class="line">kB_read&#x2F;s 每秒从驱动器读入的数据量，单位为 KB&#x2F;s。                                                                             </span><br><span class="line">kB_wrtn&#x2F;s 每秒向驱动器写入的数据量，单位为 KB&#x2F;s。                                                                             </span><br><span class="line">MB_read&#x2F;s 每秒从驱动器读入的数据量，单位为 MB&#x2F;s。                                                                             </span><br><span class="line">MB_wrtn&#x2F;s 每秒向驱动器写入的数据量，单位为MB&#x2F;s。</span><br><span class="line">rrqm&#x2F;s 将读入请求合并后，每秒发送到设备的读入请求数。   </span><br><span class="line">wrqm&#x2F;s 将写入请求合并后，每秒发送到设备的写入请求数。</span><br><span class="line">r&#x2F;s 每秒发送到设备的读入请求 数。                                                                                             </span><br><span class="line">w&#x2F;s 每秒发送到设备的写入请求 数。                                                                                             </span><br><span class="line">rsec&#x2F;s 每秒从设备读入的扇区 数。                                                                                              </span><br><span class="line">wsec&#x2F;s 每秒向设备写入的扇区 数。                                                                                              </span><br><span class="line">rkB&#x2F;s 每秒从设备读入的数据量，单位为 KB&#x2F;s。                                                                                  </span><br><span class="line">wkB&#x2F;s 每秒向设备写入的数据量，单位为 KB&#x2F;s。                                                                                  </span><br><span class="line">rMB&#x2F;s 每秒从设备读入的数据量，单位为 MB&#x2F;s。                                                                                  </span><br><span class="line">wMB&#x2F;s 每秒向设备写入的数据量，单位为 MB&#x2F;s。                                                                                  </span><br><span class="line">avgrq-sz 发送到设备的请求的平均大小，单位为扇 区。                                                                            </span><br><span class="line">avgqu-sz 发送到设备的请求的平均队列长 度。                                                                                    </span><br><span class="line">await I&#x2F;O请求平均执行时间。包括发送请求和执行的时间。单位为毫 秒。                                                   </span><br><span class="line">svctm 发送到设备的I&#x2F;O请求的平均执行时间。单位为毫 秒。                                                                      </span><br><span class="line">%util 在I&#x2F;O请求发送到设备期间，占用CPU时间的百分比。用于显示设备的带宽利用率。当这个值接近100%时，表示设备带宽已经占满。</span><br></pre></td></tr></table></figure>


<p>参考资料：</p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/shaochenshuo/article/details/76212566">https://blog.csdn.net/shaochenshuo/article/details/76212566</a></p>
<p><a target="_blank" rel="noopener" href="https://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858810.html">https://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858810.html</a>    Linux IO实时监控iostat命令详解 </p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/a454213722/article/details/25727347">https://blog.csdn.net/a454213722/article/details/25727347</a>   【io 负载分析 第一步】linux 安装sysstat使用iostat、mpstat、sar、sa</p>

    </div>

    
    
    
 
    <div>
      
        
<div class="my_post_copyright">
  <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>
  
  <!-- JS库 sweetalert 可修改路径 -->
  <script src="https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script>
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  <p><span>本文标题:</span><a href="/blog/2019/08/15/%E7%A3%81%E7%9B%98IO%E9%97%AE%E9%A2%98%E5%88%86%E6%9E%90/">磁盘IO分析</a></p>
  <p><span>文章作者:</span><a href="/" title="访问  的个人博客"></a></p>
  <p><span>发布时间:</span>2019年08月15日 - 00:08</p>
  <p><span>最后更新:</span>2020年08月31日 - 22:08</p>
  <p><span>原始链接:</span><a href="/blog/2019/08/15/%E7%A3%81%E7%9B%98IO%E9%97%AE%E9%A2%98%E5%88%86%E6%9E%90/" title="磁盘IO分析">https://linzhuangrong.gitee.io/blog/2019/08/15/%E7%A3%81%E7%9B%98IO%E9%97%AE%E9%A2%98%E5%88%86%E6%9E%90/</a>
    <span class="copy-path"  title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="https://linzhuangrong.gitee.io/blog/2019/08/15/%E7%A3%81%E7%9B%98IO%E9%97%AE%E9%A2%98%E5%88%86%E6%9E%90/"  aria-label="复制成功！"></i></span>
  </p>
  <p><span>许可协议:</span><i class="fa fa-creative-commons"></i> 转载请保留原文链接及作者。</p>  
</div>
<script> 
    var clipboard = new Clipboard('.fa-clipboard');
    $(".fa-clipboard").click(function(){
      clipboard.on('success', function(){
        swal({   
          title: "",   
          text: '复制成功',
          icon: "success", 
          showConfirmButton: true
          });
    });
    });  
</script>


      
    </div>

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/blog/tags/linux/" rel="tag"># linux</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/blog/2019/08/15/%E7%A8%8B%E5%BA%8F%E8%87%AA%E5%8A%A8%E6%8B%89%E8%B5%B7%E8%84%9A%E6%9C%AC/" rel="prev" title="程序自动拉起脚本">
      <i class="fa fa-chevron-left"></i> 程序自动拉起脚本
    </a></div>
      <div class="post-nav-item">
    <a href="/blog/2019/08/15/%E6%B5%8B%E8%AF%95%E5%8D%9A%E6%96%87/" rel="next" title="测试文章">
      测试文章 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81iostat"><span class="nav-number">1.</span> <span class="nav-text">一、iostat</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81sar"><span class="nav-number">2.</span> <span class="nav-text">二、sar</span></a></li></ol></div>
      </div>
      <!--/noindex-->
    
           <div>
            <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=144301&auto=1&height=66"></iframe>
           </div>
   
      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">林壮荣</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/blog/archives/">
        
          <span class="site-state-item-count">20</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/blog/categories/">
          
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/blog/tags/">
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">林壮荣</span>
</div>
<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共31.2k字</span>
</div>

<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<div class="powered-by">
  <i class="fa fa-user-md"></i>
  <span id="busuanzi_container_site_pv">
    本站访问量:<span id="busuanzi_value_site_pv"></span>次
  </span>
  <span class="post-meta-divider">|</span>
  <span id="busuanzi_container_site_uv">
    本站总访客量：<span id="busuanzi_value_site_uv"></span>人
  </span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>

<script src="/blog/js/utils.js"></script>

<script src="/blog/js/motion.js"></script>


<script src="/blog/js/schemes/pisces.js"></script>


<script src="/blog/js/next-boot.js"></script>




  




  
<script src="/blog/js/local-search.js"></script>













  

  

</body>
</html>
